<script type="text/javascript" src="includes/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="includes/javascript/tiny.js"></script>

<script type="text/javascript" src="jquery/jquery-latest.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.js"></script>
<script type="text/javascript" src="includes/javascript/frmregister.js"></script>
<script src="includes/javascript/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="includes/javascript/jquery.validationEngine.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
		

<script>	
$(document).ready(function() {
	$("#addnews").validationEngine()
});
// JUST AN EXAMPLE OF CUSTOM VALIDATI0N FUNCTIONS : funcCall[validate2fields]
function validate2fields(){
	if($("#fname").val() =="" ||  $("#lname").val() == ""){
		return false;
	}else{
		return true;
	}
}
</script>
<script type="text/javascript">
$(document).ready(function()
{
$("#category").change(function()
{
var id=$(this).val();
var dataString = 'id='+ id;

$.ajax
({
type: "POST",
url: "ajax_subcat.php",
data: dataString,
cache: false,
success: function(html)
{
$("#subcategory").html(html);
} 
});

$.ajax
({
type: "POST",
url: "ajax_topnews1.php",
data: dataString,
cache: false,
success: function(html)
{
$("#news").html(html);
} 
});

});

$("#subcategory").change(function()
{
var id=$(this).val();
var dataString = 'id='+ id;

$.ajax
({
type: "POST",
url: "ajax_news1.php",
data: dataString,
cache: false,
success: function(html)
{
$("#news").html(html);
} 
});

});

});
</script>


<!--Add News-->
                        <form name="associate" id="associate" enctype="multipart/form-data" method="post" action="associate_process.php">
                            
                            <table border="0" width="100%" cellspacing="0" cellpadding="2">						
                                <tr><td colspan="4" class="create">VIEW NEWS</td></tr>
								<tr><td colspan="4" style="height:15px;"></td></tr>

                                
                                <tr>
                                    <td>Categories:</td>
                                    <td><select name="category" id="category" class="category" class"validate[required]">
                                    <option selected="selected"><-- Select --></option>
                                    <?php $query3=mysql_query("select * from categories");
                                    while( $row3=mysql_fetch_array($query3))
                                   { 
                                       extract($row3);
                                       echo "<option value='".$category_id."'>".$category."</option>"; 
                                   }?>
                                        </select></td>
                                    
                                </tr>
                                <tr>
                                     <td>SubCategories:</td>
                                    <td><select name="subcategory" id="subcategory" class="subcategory" clas"validate[required]">
                                    <option value="0" selected="selected"><-- Select --></option>
                                    </select></td>                                    
                                </tr>
                                <tr>
                                    <td valign="top">News:</td>
                                    <td><div id="news" class="news"></div></td>                                    
                                </tr>                                  
                                                                                                                      
								<tr><td colspan="2" style="height:10px;"></tr>
          
                                <tr><td colspan="2" style="height:10px;"></tr>						
                                <tr>
                                    <td colspan="3" align="center"><input type="submit" name="submit" value="Submit" onClick="return validate();" class="sub-butt"/></td>
                                </tr>
                            </table>
                        </form>
                        <!--End Add Products-->
                    </td>                    
                </tr>                
            </table>
        <!--end Products-->